package com.website.system.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.website.system.dao.DrugMapper;
import com.website.system.model.Drug;
import com.website.system.service.DrugService;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

@Service
public class DrugServiceImpl extends ServiceImpl<DrugMapper, Drug> implements DrugService {
    @Resource
    DrugMapper mapper;


    @Override
    public List<Drug> findAll(String name) {
        return mapper.findAll(name);
    }

    @Override
    public int addDrug(Drug drug) {
        return mapper.addDrug(drug);
    }

    @Override
    public int updataDrug(Drug drug) {
        return mapper.updataDrug(drug);
    }

    @Override
    public Drug getById(Integer id) {
        return mapper.getById(id);
    }

    @Override
    public int addDrug(List<Drug> drug) {
        return mapper.addDrug(drug);
    }

    @Override
    public List<Drug> exportDrug() {
        return mapper.exportDrug();
    }
}
